home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / mig.h,v < prev    next >
Encoding:
Text File  |  1990-07-05  |  23.6 KB  |  860 lines

  1. head     1.15;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.15
  10. date     90.05.16.11.51.27;  author douglis;  state Exp;
  11. branches ;
  12. next     1.14;
  13.  
  14. 1.14
  15. date     90.05.16.11.39.56;  author douglis;  state Exp;
  16. branches ;
  17. next     1.13;
  18.  
  19. 1.13
  20. date     90.05.14.18.06.38;  author douglis;  state Exp;
  21. branches ;
  22. next     1.12;
  23.  
  24. 1.12
  25. date     90.05.14.18.06.05;  author douglis;  state Exp;
  26. branches ;
  27. next     1.11;
  28.  
  29. 1.11
  30. date     90.05.10.15.09.18;  author douglis;  state Exp;
  31. branches ;
  32. next     1.10;
  33.  
  34. 1.10
  35. date     90.04.26.23.51.51;  author douglis;  state Exp;
  36. branches ;
  37. next     1.9;
  38.  
  39. 1.9
  40. date     90.04.26.23.00.43;  author douglis;  state Exp;
  41. branches ;
  42. next     1.8;
  43.  
  44. 1.8
  45. date     90.02.15.19.15.06;  author douglis;  state Exp;
  46. branches ;
  47. next     1.7;
  48.  
  49. 1.7
  50. date     89.07.05.13.21.09;  author douglis;  state Exp;
  51. branches ;
  52. next     1.6;
  53.  
  54. 1.6
  55. date     89.06.23.11.27.45;  author rab;  state Exp;
  56. branches ;
  57. next     1.5;
  58.  
  59. 1.5
  60. date     88.11.18.10.22.35;  author douglis;  state Exp;
  61. branches ;
  62. next     1.4;
  63.  
  64. 1.4
  65. date     88.11.10.17.23.10;  author douglis;  state Exp;
  66. branches ;
  67. next     1.3;
  68.  
  69. 1.3
  70. date     88.09.23.09.12.14;  author douglis;  state Exp;
  71. branches ;
  72. next     1.2;
  73.  
  74. 1.2
  75. date     88.09.13.16.53.46;  author douglis;  state Exp;
  76. branches ;
  77. next     1.1;
  78.  
  79. 1.1
  80. date     88.08.12.16.24.18;  author douglis;  state Exp;
  81. branches ;
  82. next     ;
  83.  
  84.  
  85. desc
  86. @Declarations for the routines that manage the migration (load average
  87. and idle times) database.
  88. @
  89.  
  90.  
  91. 1.15
  92. log
  93. @removed padding.. didn't realize arch is 12 bytes instead of 16.
  94. @
  95. text
  96. @/*
  97.  * mig.h --
  98.  *
  99.  *    Declarations of structures, constants, and procedures to manage
  100.  *    the global database of host load averages and uptimes.
  101.  *
  102.  * Copyright 1987, 1988, 1989, 1990 Regents of the University of California
  103.  * Permission to use, copy, modify, and distribute this
  104.  * software and its documentation for any purpose and without
  105.  * fee is hereby granted, provided that the above copyright
  106.  * notice appear in all copies.  The University of California
  107.  * makes no representations about the suitability of this
  108.  * software for any purpose.  It is provided "as is" without
  109.  * express or implied warranty.
  110.  *
  111.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.14 90/05/16 11:39:56 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  112.  */
  113.  
  114. #ifndef _MIG
  115. #define _MIG
  116.  
  117. #include <fs.h>
  118.  
  119. /*
  120.  * We keep track of 1, 5, and 15-minute load averages in the database.
  121.  * We sample the load every MIG_LOAD_INTERVAL seconds and update it
  122.  * in the global daemon's database at least every MIG_GLOBAL_UPDATE_INTERVAL
  123.  * seconds.  A host is considered "down" if it hasn't updated within
  124.  * MIG_TIMEOUT seconds.
  125.  */
  126. #define MIG_NUM_LOAD_VALUES 3
  127. #define MIG_LOAD_INTERVAL 5
  128. #define MIG_GLOBAL_UPDATE_INTERVAL (12 * MIG_LOAD_INTERVAL)
  129. #define MIG_TIMEOUT (3 * MIG_GLOBAL_UPDATE_INTERVAL)
  130.  
  131. /*
  132.  * Constants affecting how hard and how often processes will try to
  133.  * contact the global daemon.  A process should sleep 1 second, try
  134.  * again, and then double the time it sleeps until it has tried
  135.  * MIG_DAEMON_RETRY_COUNT times.  2**5 is just about 30 seconds.
  136.  */
  137.  
  138. #define MIG_DAEMON_RETRY_COUNT 5
  139.  
  140. /* 
  141.  * Host states:
  142.  *
  143.  *    MIG_HOST_ACTIVE        - Host has active user, or a high load from
  144.  *                  local processes.
  145.  *    MIG_HOST_IDLE        - Host is completely idle, with no foreign
  146.  *                  processes.
  147.  *    MIG_HOST_PART_USED    - Host is being used by some processes,
  148.  *                  but still has capacity for foreign procs.
  149.  *    MIG_HOST_FULL        - Host is completely used by the highest
  150.  *                  priority processes but would otherwise
  151.  *                  accept foreign processes.
  152.  *    MIG_HOST_REFUSES    - Host refuses all migrations.
  153.  *    MIG_HOST_DOWN        - Host is not running or is unreachable.
  154.  *
  155.  * These states are associated with hosts; processes have priorities
  156.  * based on the ones defined in proc.h (PROC_HIGH/NORMAL/LOW_PRIORITY),
  157.  * but 0-based.  We also define a constant for indexing among these priorities.
  158.  */
  159. #define    MIG_HOST_ACTIVE        0
  160. #define    MIG_HOST_IDLE        1
  161. #define    MIG_HOST_PART_USED    2
  162. #define    MIG_HOST_FULL        3
  163. #define    MIG_HOST_REFUSES    4
  164. #define    MIG_HOST_DOWN        5
  165. #define MIG_NUM_STATES         (MIG_HOST_DOWN + 1)
  166.  
  167. #define MIG_LOW_PRIORITY     0
  168. #define MIG_NORMAL_PRIORITY     1
  169. #define MIG_HIGH_PRIORITY     2
  170. #define MIG_NUM_PRIORITIES     (MIG_HIGH_PRIORITY + 1)
  171.  
  172. /*
  173.  * For each machine, keep track of the timestamp for its information, various
  174.  * load averages, and info about idle time and foreign processes.
  175.  * The following structures define the way this information is used.
  176.  * A Mig_LoadVector is the load information that varies from time to time.
  177.  * This info is updated by the loadavg daemons and may be used by widgets or
  178.  * other programs that periodically sample the load average.  Other information
  179.  * is more static -- it won't change after a host boots, or it changes
  180.  * independent of the loadavg daemon (for example, when a host is used
  181.  * for migration).
  182.  */
  183.  
  184. /*
  185.  ********************************************************************
  186.  *                   IMPORTANT NOTE                 *
  187.  ********************************************************************
  188.  *                                    *
  189.  * Changes to the structures in this file must also be reflected in *
  190.  * the Fmt format strings used by the migration server.            *
  191.  *                                    *
  192.  ********************************************************************
  193.  */
  194.  
  195. typedef struct {
  196.     int     timestamp;            /* when info last updated */
  197.     int     noInput;            /* time since last input */
  198.     int        allowMigration;            /* host allowing migration? */
  199.     int        foreignProcs;            /* total number of foreign
  200.                            processes recorded
  201.                            by kernel */
  202.     int        utils[MIG_NUM_LOAD_VALUES];    /* avg utilizations (in %) */
  203.     int        pad;                /* pad structures */
  204.     double    lengths[MIG_NUM_LOAD_VALUES];    /* avg ready-queue lengths */
  205. } Mig_LoadVector;
  206.  
  207. typedef struct {
  208.     int        hostID;            /* host for which info valid */
  209.     int     bootTime;        /* when host last rebooted  */
  210.     int        migVersion;        /* migration version level of
  211.                        kernel */
  212.     int        maxProcs;        /* maximum number of foreign
  213.                        processes */
  214.     int        foreign[MIG_NUM_PRIORITIES];
  215.                         /* number of foreign
  216.                        jobs currently assigned to this
  217.                        host, for each priority */
  218.     int        state;            /* state of the host w.r.t.
  219.                        migration: see above. */
  220.     int        pad[4];            /* for future expansion */
  221.     Mig_LoadVector loadVec;        /* updated periodically by loadavg
  222.                        daemon */
  223. } Mig_Info;
  224.  
  225.  
  226. /*
  227.  * Define structures and constants for interfacing with the daemons using
  228.  * pdevs.
  229.  */
  230.  
  231. /*
  232.  * IOControls for communication between Mig lib and global migration daemon
  233.  *    IOC_MIG_GETINFO        - return Mig_Info for one or more hosts.
  234.  *    IOC_MIG_GETIDLE        - get idle host(s).
  235.  *    IOC_MIG_DONE        - return idle host(s) to free pool.
  236.  *    IOC_MIG_KILL        - remove load value(s) from database.
  237.  *    IOC_MIG_DAEMON        - flags process as a loadavg daemon
  238.  *                   and initializes load information.
  239.  *    IOC_MIG_CHANGE        - daemon is changing host status.
  240.  *    IOC_MIG_GET_PARAMS     - get system parameters.
  241.  *    IOC_MIG_SET_PARAMS     - set system parameters (must be root).
  242.  *    IOC_MIG_GET_STATS     - get statistics.
  243.  *    IOC_MIG_GET_UPDATE     - get update on host availability.
  244.  *    IOC_MIG_EVICT        - force all processes to be evicted.
  245.  *    IOC_MIG_RESET_STATS     - reset statistics.
  246.  */
  247.  
  248. #define IOC_MIG_GETINFO        (IOC_GENERIC_LIMIT+1)
  249. #define IOC_MIG_GETIDLE         (IOC_GENERIC_LIMIT+2)
  250. #define IOC_MIG_DONE            (IOC_GENERIC_LIMIT+3)
  251. #define IOC_MIG_KILL            (IOC_GENERIC_LIMIT+4)
  252. #define IOC_MIG_DAEMON        (IOC_GENERIC_LIMIT+5)
  253. #define IOC_MIG_CHANGE          (IOC_GENERIC_LIMIT+6)
  254. #define IOC_MIG_GET_PARAMS      (IOC_GENERIC_LIMIT+7)
  255. #define IOC_MIG_SET_PARAMS      (IOC_GENERIC_LIMIT+8)
  256. #define IOC_MIG_GET_STATS    (IOC_GENERIC_LIMIT+9)
  257. #define IOC_MIG_GET_UPDATE    (IOC_GENERIC_LIMIT+10)
  258. #define IOC_MIG_EVICT        (IOC_GENERIC_LIMIT+11)
  259. #define IOC_MIG_RESET_STATS    (IOC_GENERIC_LIMIT+12)
  260. #define IOC_MIG_LASTCMD        IOC_MIG_RESET_STATS
  261.  
  262. /*
  263.  * IOC_MIG_GETINFO -
  264.  * For requesting information about host statuses.  Returns the number
  265.  * of hosts for which information is returned, followed by an array of
  266.  * Mig_Info structures.  The data returned are not aligned as though
  267.  * they were in a structure; therefore, the caller may need to bcopy
  268.  * from a character buffer into a structure to make use of the data.
  269.  * The normal interface to get this info is via the library routine
  270.  * Mig_GetAllInfo or Mig_GetInfo, which get the Mig_Info structures
  271.  * for many hosts or a single host, respectively [due to historical
  272.  * reasons].
  273.  */
  274.  
  275. typedef struct {
  276.     int firstHost;        /* ID of first host requested. */
  277.     int numRecs;        /* Number of entries requested. */
  278. } Mig_InfoRequest;
  279.  
  280.  
  281. /*
  282.  * IOC_MIG_GETIDLE -
  283.  *
  284.  * For requesting idle hosts.  Returns the number of hosts assigned followed
  285.  * by the numeric identifiers of the hosts.
  286.  */
  287.  
  288. typedef struct {
  289.     int numHosts;        /* Number of hosts requested. */
  290.     int flags;            /* Flags, defined below. */
  291.     int priority;        /* Priority of processes, defined above. */
  292.     int    virtHost;        /* Virtual host of process making request. */
  293. } Mig_IdleRequest;
  294.  
  295. /*
  296.  * Flags for foreign processes:
  297.  *
  298.  *     MIG_PROC_RELOCATE    - Wish to relocate if evicted.
  299.  *     MIG_PROC_AGENT        - Request is on behalf of another process.
  300.  *                  Do not reclaim host because process that
  301.  *                  makes the request closes its connection.
  302.  */
  303.  
  304. #define MIG_PROC_RELOCATE    0x0001
  305. #define MIG_PROC_AGENT        0x0002
  306.  
  307.  
  308. /*
  309.  * IOC_MIG_DONE -
  310.  *
  311.  * For returning idle hosts to the pool, or removing hosts from the database,
  312.  * An array of hostIDs is passed.  In each case, nothing is returned.
  313.  * MIG_ALL_HOSTS indicates that the operation should be performed for
  314.  * all hosts (either hosts in use for migration, or every host in the database,
  315.  * respectively).  Hosts are reclaimed implicitly if the process closes the
  316.  * pdev talking to the server (including if it exits).
  317.  */
  318.  
  319. #define MIG_ALL_HOSTS 0
  320.  
  321. /*
  322.  * IOC_MIG_GET_UPDATE -
  323.  *
  324.  * For getting updates to host availability.  The caller is responsible
  325.  * for making as many ioctls as needed until the stream is not selectable,
  326. x * since only a single update is transferred with each ioctl. (Normally
  327.  * only one is necessary.)
  328.  *
  329.  * There is no input for this ioctl. The output is an integer specifying
  330.  * a host that is no longer available, or 0, indicating that a new
  331.  * host is available and IOC_MIG_GET_IDLE should be used to get a new
  332.  * host.
  333.  */
  334.  
  335. /*
  336.  * IOC_MIG_GET_STATS -
  337.  * IOC_MIG_RESET_STATS -
  338.  *
  339.  * GET_STATS returns a structure, defined below.  RESET_STATS takes and
  340.  * returns no arguments.
  341.  *
  342.  * Define the structure used to maintain statistics for migration.  Note
  343.  * that changes to these structures must be reflected in the byte-swapping
  344.  * constants used by the migration daemon.
  345.  *
  346.  * Define the maximum number of architecture types we'll
  347.  * keep statistics about, and statistics that are kept track of on a
  348.  * per-machine-type basis.
  349.  *
  350.  * MIG_MAX_ARCH_TYPES     - maximum number of architectures managed by migd.
  351.  *            - This can be increased, but only by complicating
  352.  *              the interface to obtain statistics so it can
  353.  *              transfer the buffer in pieces.
  354.  * MIG_MAX_ARCH_LEN     - maximum length of a string used in stats.
  355.  * MIG_MAX_HOSTS_DIST     - maximum number of hosts in a request that we'll keep
  356.  *              track of (i.e. last element of array is this many
  357.  *              or more).
  358.  * MIG_INTERVAL_PERIOD  - number of seconds between incrementing counters
  359.  * MIG_STATS_VERSION    - version of statistics structure, to catch
  360.  *              inconsistencies.
  361.  */
  362.  
  363. #define MIG_MAX_ARCH_TYPES 8
  364. #define MIG_MAX_ARCH_LEN 12
  365. #define MIG_MAX_HOSTS_DIST 20
  366. #define MIG_INTERVAL_PERIOD 300
  367. #define MIG_STATS_VERSION 5
  368.  
  369.  
  370. /*
  371.  * Statistics that are kept as a sum and as a sum of squares (for standard
  372.  * deviation).  The ones that are likely to overflow are kept as two
  373.  * integers and a macro is used to add to them.
  374.  */
  375.  
  376. #define MIG_COUNTER_HIGH 1
  377. #define MIG_COUNTER_LOW 0
  378.  
  379. typedef struct {
  380.     unsigned int requested;        /* Number of hosts requested. */
  381.     unsigned int obtained;        /* Number of hosts obtained. */
  382.     unsigned int evicted;        /* Number of hosts taken back from
  383.                        client due to eviction. */
  384.     unsigned int reclaimed;        /* Number of hosts taken back from
  385.                        client due to other causes
  386.                        (e.g., fairness). */
  387.     unsigned int timeUsed;        /* Total time before returning hosts,
  388.                        in seconds. */
  389.     unsigned int timeToEviction;    /* Total time before evictions occur. */
  390.     unsigned int hostIdleObtained[2];    /* Idle time of hosts obtained when
  391.                        assigned, in minutes. */
  392.     unsigned int hostIdleEvicted[2];    /* Idle time of hosts at time they are
  393.                        assigned, just for those hosts that
  394.                        later evict processes. */
  395.     unsigned int idleTimeWhenActive[2];    /* The amount of time hosts were idle
  396.                        when they became non-idle. */
  397.     unsigned int hostCounts[MIG_NUM_STATES]; /* Number of hosts in each
  398.                         state. */
  399.     int pad[2];                /* Pad to double-word boundary. */
  400. } Mig_StatTotals;
  401.  
  402. typedef struct {
  403.     char arch[MIG_MAX_ARCH_LEN];    /* String representation of machine
  404.                        type. */
  405.     unsigned int numClients;        /* Number of processes requesting
  406.                        hosts. */
  407.     unsigned int gotAll;        /* Number of processes getting as
  408.                        many hosts as requested. */
  409.     unsigned int requestDist[MIG_MAX_HOSTS_DIST + 1];
  410.                         /* Distribution of maximum number of
  411.                        hosts requested. */
  412.     unsigned int obtainedDist[MIG_MAX_HOSTS_DIST + 1];
  413.                         /* Distribution of maximum number of
  414.                        hosts obtained. */
  415.     unsigned int nonIdleTransitions;    /* Number of times hosts went from
  416.                        idle to non-idle. */
  417.     Mig_StatTotals counters;        /* Counters of different types of
  418.                        operations, cumulative. */
  419.     Mig_StatTotals squared;        /* Sum of Squares of above counters
  420.                        (for calculating std. dev.). */
  421. } Mig_ArchStats;
  422.  
  423. typedef struct {
  424.     unsigned int version;        /* Version number of the daemon. */
  425.     unsigned int checkpointInterval;    /* Interval for checkpointing (and
  426.                        incrementing counters). */
  427.     unsigned int firstRun;        /* Time when statistics first started
  428.                        gathering. */
  429.     unsigned int restarts;        /* Number of times the daemon
  430.                        restarted. */
  431.     unsigned int intervals;        /* Number of intervals over which
  432.                        statistics have been gathered. */
  433.     unsigned int maxArchs;        /* Maximum number of architecture
  434.                        types we know about. */
  435.     unsigned int getLoadRequests;    /* Number of times clients asked for
  436.                        load info. */
  437.     unsigned int totalRequests;        /* Total number of times hosts were
  438.                        requested. */
  439.     unsigned int totalObtained;        /* Total number of times hosts were
  440.                        assigned. */
  441.     unsigned int numRepeatRequests;    /* Number of times the requesting host
  442.                        was the same as the previous
  443.                        request. */
  444.     unsigned int numRepeatAssignments;    /* Number of times the same
  445.                        <physical,virtual> host pair was
  446.                        assigned twice in a row. */
  447.     unsigned int numFirstAssignments;    /* Number of assignments that were
  448.                        to hosts that hadn't been assigned
  449.                        to anyone since going idle.*/
  450.     Mig_ArchStats archStats[MIG_MAX_ARCH_TYPES]; /* Per-architecture stats. */
  451. } Mig_Stats;    
  452.  
  453.  
  454. /*
  455.  * IOC_MIG_KILL          - sends int.
  456.  * IOC_MIG_DAEMON     - sends Mig_Info structure.
  457.  * IOC_MIG_CHANGE      - sends int.
  458.  * IOC_MIG_EVICT      - receives int.
  459.  */
  460.  
  461. /*
  462.  * IOC_MIG_GET_PARAMS -
  463.  * IOC_MIG_SET_PARAMS -
  464.  *
  465.  * Define the parameters used by the migration daemons.  This can be
  466.  * updated or obtained via an ioctl.  If the global daemon is updated
  467.  * then it notifies the other daemons to retrieve the new parameters.
  468.  * One can also connect to the local daemon and modify the info for a
  469.  * particular host.  The migration version and criteria are not
  470.  * broadcast from the global server.  
  471.  *
  472.  * The criteria for allowing migration, unless overridden, are idle
  473.  * time (noInput) and ready queue lengths.  If we are not allowing
  474.  * foreign processes, but our time since last input is greater than
  475.  * noInput and our average queue lengths are ALL less than the
  476.  * corresponding values in min, start accepting foreign processes.  If
  477.  * we are allowing foreign processes and either the idle time drops or
  478.  * ANY of the average queue lengths exceeds its corresponding value in
  479.  * max, stop accepting them.
  480.  */
  481.  
  482. typedef struct {
  483.     int        criteria;            /* Whom to allow, and when
  484.                            (c.f. proc.h). */
  485.     int        version;            /* Migration version. */
  486.     int        noInput;            /* Idle time needed. */
  487.     int        pad;                /* Fill out to doubleword. */
  488.     double    minThresh[MIG_NUM_LOAD_VALUES];    /* Minimum load before
  489.                            becoming idle */
  490.     double    maxThresh[MIG_NUM_LOAD_VALUES];    /* Maximum load before
  491.                            refusing migrations once
  492.                            idle. */
  493. } Mig_SystemParms;
  494.  
  495.  
  496. /* 
  497.  * Declare the global variables that refer to the pdevs used.  
  498.  */
  499. extern int mig_GlobalPdev;     
  500. extern int mig_LocalPdev;
  501.  
  502.  
  503. extern Mig_Info *    Mig_GetInfo();
  504. extern int         Mig_GetAllInfo();
  505. extern int         Mig_GetIdleNode();
  506. extern int         Mig_OpenInfo();
  507. extern int         Mig_UpdateInfo();
  508. extern int         Mig_Done();
  509. extern int         Mig_ConfirmIdle();
  510. extern int         Mig_DeleteHost();
  511. extern int         Mig_Evict();
  512. extern char *         Mig_GetPdevName();
  513. extern int         Mig_OpenPdev();
  514.  
  515. #endif /* _MIG */
  516. @
  517.  
  518.  
  519. 1.14
  520. log
  521. @changes for statistics again
  522. @
  523. text
  524. @d16 1
  525. a16 1
  526.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.13 90/05/14 18:06:38 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  527. a321 1
  528.     int pad[3];                /* Pad to double-word boundary. */
  529. @
  530.  
  531.  
  532. 1.13
  533. log
  534. @changed stats version too.
  535. @
  536. text
  537. @d16 1
  538. a16 1
  539.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.12 90/05/14 18:06:05 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  540. d272 1
  541. a272 1
  542. #define MIG_STATS_VERSION 4
  543. a319 9
  544.     unsigned int numRepeatRequests;    /* Number of times the requesting host
  545.                        was the same as the previous
  546.                        request. */
  547.     unsigned int numRepeatAssignments;    /* Number of times the same
  548.                        <physical,virtual> host pair was
  549.                        assigned twice in a row. */
  550.     unsigned int numFirstAssignments;    /* Number of assignments that were
  551.                        to hosts that hadn't been assigned
  552.                        to anyone since going idle.*/
  553. d322 1
  554. a322 1
  555.     int pad;                /* Pad to double-word boundary. */
  556. d343 13
  557. a355 2
  558.     int pad;                /* Pad out to a double-word
  559.                        boundary. */
  560. @
  561.  
  562.  
  563. 1.12
  564. log
  565. @added a stats field
  566. @
  567. text
  568. @d16 1
  569. a16 1
  570.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.11 90/05/10 15:09:18 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  571. d272 1
  572. a272 1
  573. #define MIG_STATS_VERSION 3
  574. @
  575.  
  576.  
  577. 1.11
  578. log
  579. @changes for statistics
  580. @
  581. text
  582. @d16 1
  583. a16 1
  584.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.10 90/04/26 23:51:51 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  585. d326 3
  586. d331 1
  587. a331 1
  588.     int pad[2];                /* Pad to double-word boundary. */
  589. @
  590.  
  591.  
  592. 1.10
  593. log
  594. @changed MIG_MAX_ARCH_TYPES to 8 instead of 12, to cut down the ioctl below
  595. 4K.
  596. @
  597. text
  598. @d7 1
  599. a7 1
  600.  * Copyright 1987, 1988, 1989 Regents of the University of California
  601. d16 1
  602. a16 1
  603.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.9 90/04/26 23:00:43 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  604. d247 4
  605. a250 1
  606.  * Define the structure used to maintain statistics for migration.
  607. d264 2
  608. d272 2
  609. d312 2
  610. d320 3
  611. d328 1
  612. a328 1
  613.     int pad[4];                /* Pad to double-word boundary. */
  614. @
  615.  
  616.  
  617. 1.9
  618. log
  619. @changes for statistics gathering
  620. @
  621. text
  622. @d16 1
  623. a16 1
  624.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.8 90/02/15 19:15:06 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  625. d253 3
  626. d263 1
  627. a263 1
  628. #define MIG_MAX_ARCH_TYPES 12
  629. @
  630.  
  631.  
  632. 1.8
  633. log
  634. @new version for migration daemon
  635. @
  636. text
  637. @d16 1
  638. a16 1
  639.  * $Header: /user2/douglis/pdev_mig/migd/RCS/mig.h,v 2.2 90/02/11 23:34:43 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  640. d70 1
  641. d75 1
  642. a75 1
  643. #define MIG_NUM_PRIORITIES     (MIG_HIGH_PRIORITY +1)
  644. d147 1
  645. a147 1
  646.  *    IOC_MIG_GET_STATS     - get statistcs.
  647. d150 1
  648. d164 2
  649. a165 1
  650. #define IOC_MIG_LASTCMD        IOC_MIG_EVICT
  651. a225 1
  652.  
  653. d231 1
  654. a231 1
  655.  * since only a single update is transferred with each ioctl. (Normally
  656. d242 95
  657. a336 9
  658.  * Define a structure to maintain statistics for migration.
  659.  */
  660. typedef struct {
  661.     int    requested;        /* Number of hosts requested. */
  662.     int obtained;        /* Number of hosts obtained. */
  663.     int evictions;        /* Number of hosts taken back from clients
  664.                    due to eviction. */
  665.     int reclaims;        /* Number of hosts taken back from clients
  666.                    due to other causes (e.g., fairness). */
  667. a379 1
  668.  
  669. @
  670.  
  671.  
  672. 1.7
  673. log
  674. @added Mig_ConfirmIdle
  675. @
  676. text
  677. @d7 1
  678. a7 1
  679.  * Copyright 1987, 1988 Regents of the University of California
  680. d16 1
  681. a16 1
  682.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.6 89/06/23 11:27:45 rab Exp Locker: douglis $ SPRITE (Berkeley)
  683. d22 2
  684. d26 4
  685. a29 3
  686.  * The timeout is used to determine whether a host is still alive, for
  687.  * purposes of selecting an idle host for migration.  It is measured in
  688.  * seconds.
  689. d32 43
  690. a74 1
  691. #define MIG_TIMEOUT 180
  692. d77 9
  693. a85 3
  694.  * For each machine, keep track of the timestamp for its information and the
  695.  * different load averages reported.  The following structure defines the
  696.  * way this information is used internally.
  697. d88 11
  698. a99 4
  699.     int        hostID;                /* host for which info valid */
  700.     int        utils[MIG_NUM_LOAD_VALUES];    /* avg utilizations (in %) */
  701.     double    lengths[MIG_NUM_LOAD_VALUES];    /* avg ready-queue lengths */
  702.     int     bootTime;            /* when host last rebooted  */
  703. d103 24
  704. a126 5
  705.     int        foreignProcs;            /* number of foreign
  706.                          * processes currently on */
  707.     int        migVersion;            /* migration version level of
  708.                          * kernel */
  709.     int        pad;                /* for future expansion */
  710. d129 109
  711. d239 62
  712. a300 11
  713.  * The type of the file may be specified as either MIG_PRIVATE
  714.  * or MIG_SHARED to indicate the default file name.  The private
  715.  * file is in /hosts and is presumably updated and read all on one
  716.  * host, while the shared file is updated by multiple hosts
  717.  * concurrently and is therefore noncacheable.
  718.  */
  719.  
  720. typedef enum {
  721.     MIG_SHARED,
  722.     MIG_PRIVATE
  723. } Mig_FileType;
  724. d309 4
  725. @
  726.  
  727.  
  728. 1.6
  729. log
  730. @*** empty log message ***
  731. @
  732. text
  733. @d16 1
  734. a16 1
  735.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.5 88/11/18 10:22:35 douglis Exp Locker: rab $ SPRITE (Berkeley)
  736. d71 1
  737. @
  738.  
  739.  
  740. 1.5
  741. log
  742. @added migVersion, pad to Mig_Info structure.
  743. @
  744. text
  745. @d16 1
  746. a16 1
  747.  * $Header: /sprite/src/lib/include/RCS/mig.h,v 1.4 88/11/10 17:23:10 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  748. d64 1
  749. a64 1
  750.         
  751. d72 1
  752. a72 1
  753. #endif _MIG
  754. @
  755.  
  756.  
  757. 1.4
  758. log
  759. @added Mig_Done.
  760. @
  761. text
  762. @d16 1
  763. a16 1
  764.  * $Header: /sprite/src/lib/include.new/RCS/mig.h,v 1.3 88/09/23 09:12:14 douglis Exp Locker: douglis $ SPRITE (Berkeley)
  765. d47 3
  766. @
  767.  
  768.  
  769. 1.3
  770. log
  771. @Added comments in typedef; changed some function names to track changes
  772. in the library.
  773. @
  774. text
  775. @d16 1
  776. a16 1
  777.  * $Header: mig.h,v 1.2 88/09/13 16:53:46 douglis Exp $ SPRITE (Berkeley)
  778. d45 2
  779. d67 1
  780. @
  781.  
  782.  
  783. 1.2
  784. log
  785. @Changed HostInfo to Mig prefix.
  786. @
  787. text
  788. @d16 1
  789. a16 1
  790.  * $Header: mig.h,v 1.1 88/08/12 16:24:18 douglis Exp $ SPRITE (Berkeley)
  791. d38 7
  792. a44 7
  793.     int        hostID;
  794.     int        utils[MIG_NUM_LOAD_VALUES];
  795.     double    lengths[MIG_NUM_LOAD_VALUES];
  796.     int     bootTime;
  797.     int     timestamp;
  798.     int     noInput;
  799.     int        allowMigration;
  800. a59 1
  801. extern int         Mig_UpdateInfo();
  802. d61 1
  803. d63 2
  804. a64 1
  805. extern void         Mig_SetInfoFile();
  806. @
  807.  
  808.  
  809. 1.1
  810. log
  811. @Initial revision
  812. @
  813. text
  814. @d2 1
  815. a2 1
  816.  * hostInfo.h --
  817. d16 1
  818. a16 1
  819.  * $Header: hostInfo.h,v 1.1 88/07/14 17:27:32 ouster Exp $ SPRITE (Berkeley)
  820. d19 2
  821. a20 2
  822. #ifndef _HOSTINFO
  823. #define _HOSTINFO
  824. d28 2
  825. a29 2
  826. #define HOST_INFO_NUM_LOAD_VALUES 3
  827. #define HOST_INFO_TIMEOUT 180
  828. d33 2
  829. a34 3
  830.  * different load averages reported.   Also, the architecture type
  831.  * (e.g., sun2/sun3/spur) is stored to make sure we can migrate to a machine
  832.  * of the same type.
  833. d39 2
  834. a40 3
  835.     int        archType;
  836.     int        utils[HOST_INFO_NUM_LOAD_VALUES];
  837.     double    lengths[HOST_INFO_NUM_LOAD_VALUES];
  838. d45 1
  839. a45 1
  840. } Host_Info;
  841. d48 2
  842. a49 2
  843.  * The type of the file may be specified as either HOST_INFO_PRIVATE
  844.  * or HOST_INFO_SHARED to indicate the default file name.  The private
  845. d56 3
  846. a58 3
  847.     HOST_INFO_SHARED,
  848.     HOST_INFO_PRIVATE
  849. } Host_InfoFileType;
  850. d60 4
  851. a63 4
  852. extern int         Host_UpdateInfo();
  853. extern Host_Info *   Host_GetInfo();
  854. extern int         Host_GetIdleNode();
  855. extern void         Host_SetInfoFile();
  856. d65 1
  857. a65 1
  858. #endif _HOSTINFO
  859. @
  860.